PICTools Programmer's Reference
Remove Horizontal and Vertical Lines

Removes horizontal and vertical black lines from 1 bit images. After removing the lines, any intersecting characters or other image content will be reconstructed as accurately as possible.

LinesBefore  →  LinesAfter

The uncompressed image to be processed must reside in the Get Queue prior to REQ_EXEC. Typically, the image will be fully contained in the Get Queue, but that is not a requirement. The output image will be placed into the Put Queue during REQ_EXEC.

Padding pixels present at the end of each line may be modified by this operation.

This operation relies primarily on three parameters to select the lines to remove: minimum length, maximum thickness, and minimum aspect ratio. Of the three, minimum length is the most commonly adjusted one. All three criteria must be true of a line for it to be removed. A fourth parameter, maximum gap, allows a broken line to be treated as a single line instead of multiple smaller lines. The remaining parameters control optional activities applied in conjunction with line removal.

There are two independent sets of parameters, one for horizontal lines (u.SC2.HorizontalLine) and one for vertical lines (u.SC2.VerticalLine).

In addition to placing an output image into the Put Queue, this operation stores some output information into the PIC_PARM structure in the following locations.

If the ReportingDatafield is set to point to a ScanFixReportDatainstance, then the defer function will be called with a value of RES_QUERYfor every line detected in the image.  The ScanFixReportData.Subcode will be set to SF_SUBCODE_REMOVE_LINES, and ScanFixReportData.u.LineData will contain information about the currently selected line.  If the line is to be deleted, then ScanFixReportData.u.LineData.DeleteLineshould be set to a non-zero value.  If ScanFixReportData.Stopis set to a non-zero value, then the defer function will not be called for any subsequent lines in the image, and all remaining lines will be left in the image.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback